WPS Office.apk(点击下载) / hmi.java


package defpackage;

import android.text.TextUtils;
import android.util.Base64;
import cn.wps.moffice.OfficeApp;
import cn.wps.shareplay.message.Message;
import com.baidu.tts.loopj.RequestParams;
import com.google.firebase.perf.FirebasePerformance;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import org.apache.james.mime4j.field.FieldName;

/* renamed from: hmi  reason: default package */
public abstract class hmi<T> extends vys<T> {
    protected hlz itV;
    protected String iuz;

    public hmi(int i, String str, hlz hlz) {
        super(i, "http://dcapi2.wps.cn" + str, hlz);
        this.iuz = str;
        this.itV = hlz;
        this.mTag = "ConvertServer";
    }

    /* access modifiers changed from: protected */
    public String cfv() {
        return "";
    }

    @Override // defpackage.vys
    public final String getBodyContentType() {
        return RequestParams.APPLICATION_JSON;
    }

    @Override // defpackage.vys
    public Map<String, String> getHeaders() {
        String str;
        OfficeApp arx = OfficeApp.arx();
        String str2 = arx.cqM;
        String arB = arx.arB();
        String str3 = eip.dHN;
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss ", Locale.US);
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+08:00"));
        String concat = simpleDateFormat.format(date).concat("GMT");
        String cfs = this.itV.cfs();
        switch (this.aGt) {
            case 0:
                str = "GET";
                break;
            case 1:
                str = FirebasePerformance.HttpMethod.POST;
                break;
            case 2:
                str = FirebasePerformance.HttpMethod.PUT;
                break;
            case 3:
                str = "DELETE";
                break;
            case 4:
                str = FirebasePerformance.HttpMethod.HEAD;
                break;
            case 5:
                str = FirebasePerformance.HttpMethod.OPTIONS;
                break;
            case 6:
                str = FirebasePerformance.HttpMethod.TRACE;
                break;
            case 7:
                str = "PATCH";
                break;
            default:
                str = "GET";
                break;
        }
        String str4 = this.iuz;
        String cfv = cfv();
        StringBuilder append = new StringBuilder("wpsvas:").append(cfs).append(":4cdb5a65fc7c6331c7e5c520a064909a").append(Message.SEPARATE2);
        String sb = append.append(Base64.encodeToString(hmd.Ao(str.toUpperCase() + "\n" + "\n" + RequestParams.APPLICATION_JSON + "\n" + concat + "\n" + str4 + "\n" + cfv + "\n" + "4cdb5a65fc7c6331c7e5c520a064909a" + "\n" + "wps-android" + "\n" + "").getBytes(), 10)).toString();
        HashMap hashMap = new HashMap();
        hashMap.put(FieldName.DATE, concat);
        hashMap.put("WPSVASDevToken", sb);
        hashMap.put("Client-Type", "wps-android");
        hashMap.put("Client-Chan", arB);
        hashMap.put("Client-Lang", str3);
        hashMap.put("Content-Type", RequestParams.APPLICATION_JSON);
        hashMap.put("Client-Ver", str2);
        String str5 = this.itV.itY.iuf;
        if (!TextUtils.isEmpty(str5)) {
            hashMap.put("Servertag", str5);
        }
        return hashMap;
    }
}